<template>
  <div class="app-container">
    <div class="meeting-list-head">
      <search-form :searchFormAction="searchFormAction" @search-submit="searchSubmit" />
    </div>
    <div class="meeting-list-tab">
     <tabs-view
       ref="tabsView"
       :headerList="headerList"
       :display-pag="true"
       :params="params"
       @tab-switch="tabSwitch"
       @get-list="getList"

     >
       <template slot="content">
         <el-table :data="tableDate" border style="width: 100%">
           <el-table-column label="序号" align="center" prop="id" />
           <el-table-column label="会议状态" align="center"  prop="meetingStatus" />
           <el-table-column label="会议时间" align="center"  prop="meetingDate" />
           <el-table-column label="会议地点" align="center"  prop="meetingPlace" />
           <el-table-column label="参会人" align="center"  prop="attendee" />
           <el-table-column label="记录人" align="center"  prop="recorder" />
           <el-table-column label="会议记录" align="center" >
             <el-link type="primary" :underline="false">编辑</el-link>
             <el-link type="primary" :underline="false">/查看</el-link>
           </el-table-column>
           <el-table-column label="操作" align="center">
             <el-button
               type="text"
               size="mini"
             >会议详情
             </el-button>
             <el-button
               type="text"
               size="mini"
             >打印汇总
             </el-button>
           </el-table-column>
         </el-table>
       </template>
     </tabs-view>
    </div>


  </div>
</template>

<script>
import TabsView from '../components/tabs-view'
import SearchForm from '../components/search-form'

export default {
  name: "MeetingList",
  components: {
    TabsView,
    SearchForm
  },
  data() {
    return {
      tableDate: [],
      params: {},
      headerList: [
        { title: '所有会议', index: 1, value: 0},
        { title: '待开始', index: 2, value: 0},
        { title: '举行中', index: 3, value: 0},
        { title: '待总结', index: 4, value: 0},
        { title: '已举行', index: 5, value: 0}
      ],
      searchFormAction: [
        {
          label: '会议状态',
          prop: 'meetingStatus',
          placeholder: '',
          i18n: 'meeting-list.meetingStatus',
          type: 'select',
          dictData: [],
          l_weight: '80px',
          span: 4
        },
        {
          label: '会议时间',
          prop: 'meetingDate',
          placeholder: '',
          i18n: 'meeting-list.meetingDate',
          type: 'select',
          dictData: [],
          l_weight: '80px',
          span: 4
        }
      ]

    }
  },
  methods: {
    // tab栏切换事件
    tabSwitch(index) {
      console.log(index)
    },
    searchSubmit(query) {
      this.params = query;
      Object.assign(this.params, this.$refs.tabsView.$data.queryParams);
      this.getList(this.params)
    },
    getList(params) {
      // 合并对象
      console.log(params)
    }
  }
}
</script>

<style scoped>

</style>
